package com.imu.purse.modules.trade.form;

import com.alibaba.fastjson.annotation.JSONField;
import com.imu.common.validator.group.AddGroup;
import com.imu.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotBlank;
import java.math.BigDecimal;

@Data
public class PriequityForm {
    @JSONField(ordinal = 1)
    @ApiModelProperty(value = "购买贝壳数", name="buyNum", required = true, example="1")
    @NotNull(message="购买贝壳数", groups = {AddGroup.class, UpdateGroup.class})
    @Min(value=1, message="贝壳数不能小于1", groups = {AddGroup.class, UpdateGroup.class})
    @Digits(integer=4,fraction=0, message="贝壳必须是整数", groups = {AddGroup.class, UpdateGroup.class})
    private BigDecimal buyNum;

    @JSONField(ordinal = 2)
    @ApiModelProperty(value = "支付金额", name="payMoney", required = true, example="100")
    @NotNull(message="支付金额不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Min(value=0, message="支付金额不能小于0", groups = {AddGroup.class, UpdateGroup.class})
    private BigDecimal payMoney;
    
    @JSONField(ordinal = 3)
    @ApiModelProperty(value = "支付易买宝数", name="payBj", required = true, example="1")
    @NotNull(message="易买宝数不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Min(value=0, message="易买宝数不能小于0", groups = {AddGroup.class, UpdateGroup.class})
    private BigDecimal payBj;
    
    @JSONField(ordinal = 4)
    @ApiModelProperty(value = "支付IMU数", name="payImu", required = true, example="1")
    @NotNull(message="IMU数不能为空", groups = {AddGroup.class})
    @Min(value=0, message="IMU数不能小于0", groups = {AddGroup.class})
    private BigDecimal payImu;
    
    @JSONField(ordinal = 5)
    @ApiModelProperty(value = "支付GET数", name="payGet", required = true, example="1")
    @NotNull(message="GET数不能为空", groups = {UpdateGroup.class})
    @Min(value=0, message="GET数不能小于0", groups = {UpdateGroup.class})
    private BigDecimal payGet;
    
    @JSONField(ordinal = 6)
    @ApiModelProperty(value = "类型(0贝壳)", name="type", required = true, example="0")
    @NotNull(message="类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Min(value=0, message="类型不能小于0元", groups = {AddGroup.class, UpdateGroup.class})
    private Integer type;
    
    @JSONField(ordinal = 7)
    @ApiModelProperty(value = "验证码", name="acode", required = true, example="123456")
    @NotBlank(message="图片验证码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String acode;
    
    @JSONField(ordinal = 8)
    @ApiModelProperty(value = "支付密码", name="pwd", required = true, example="123456")
    @NotBlank(message="支付密码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String pwd;
}
